<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      >

    <ui:composition template="./WEB-INF/includes-templates/template_viewer.xhtml">
        <ui:param name="pageTitle" value="#{trans.system_name}" />
        <ui:define name="content" >
            <script type="text/javascript" > 
    
                function foo(){
                    if (#{viewer.activeComments}){
                        if (#{viewer.actualTool == 1}){
                                    
                            dlgcomment.show();
                        
                        } else if (#{viewer.actualTool == 0}){
                        
                            layoutWdgt.toggle('east');
                        
                        
                        
                        }else if (#{viewer.actualTool == 2}){
                            dlgcomment.show();
                        }
                    }
                }
    
    
            </script>


            <h:form id="imageForm">

                <p:growl id="messages2" life="1500"  />
                <p:graphicImage value="#{reader.getPagePath(viewer.actualPage)}" width="#{viewer.actualZoom}%"
                                style="display: block;   margin-left: auto;   margin-right: auto; box-shadow: 2px 0px 6px #888888; "
                                onclick="foo()" >

                </p:graphicImage>



                <p:dialog id="dlgcomment" header="#{trans.newComment}" widgetVar="dlgcomment" 
                          style="z-index: 999 !important;" >  

                    <p:inputTextarea id="editor" value="#{comment.content}" cols="40"/>  
                    <br />

                    <p:commandButton id="submitButton" value="#{trans.b_save}"  icon="ui-icon-disk"
                                     action="#{comment.saveComment()}" onclick="dlgcomment.close();" ajax="false"/>  

                </p:dialog>



            </h:form>

            <p:ajaxStatus style="width:64px;height:64px;position:fixed;right:320px;bottom:5px;" id="ajaxStatus" >  
                <f:facet name="start">  
                    <p:graphicImage value="resources/images/loading.gif" />  
                </f:facet>  

                <f:facet name="complete">  
                    <h:outputText value="" />  
                </f:facet>  
            </p:ajaxStatus>


        </ui:define>

    </ui:composition>


</html>
